package com.bootdo.system.service.impl;

import com.bootdo.system.dao.DlPositionSubclassDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.bootdo.system.dao.DlPositionDao;
import com.bootdo.system.domain.DlPositionDO;
import com.bootdo.system.service.DlPositionService;



@Service
public class DlPositionServiceImpl implements DlPositionService {
	@Autowired
	private DlPositionDao dlPositionDao;
	@Autowired
	private DlPositionSubclassDao dlPositionSubclassDao;

	@Override
	public DlPositionDO get(Integer positionId){
		return dlPositionDao.get(positionId);
	}
	
	@Override
	public List<DlPositionDO> list(Map<String, Object> map){
		List<DlPositionDO> list = dlPositionDao.list(map);
		for (DlPositionDO dlPositionDO : list) {
			dlPositionDO.setPositionSubclassTitle(dlPositionSubclassDao.get(dlPositionDO.getPositionSubclassId()).getTitle());
		}

		return list;
	}
	
	@Override
	public int count(Map<String, Object> map){
		return dlPositionDao.count(map);
	}
	
	@Override
	public int save(DlPositionDO dlPosition){
		return dlPositionDao.save(dlPosition);
	}
	
	@Override
	public int update(DlPositionDO dlPosition){
		return dlPositionDao.update(dlPosition);
	}
	
	@Override
	public int remove(Integer positionId){
		return dlPositionDao.remove(positionId);
	}
	
	@Override
	public int batchRemove(Integer[] positionIds){
		return dlPositionDao.batchRemove(positionIds);
	}
	
}
